<template>
  <div>
    <!-- 
      key的值为 唯一的字符串 或 数字
    -->
    <ul>
      <li v-for="item in arr" :key="item.id">{{ item.name }}</li>
    </ul>
    <button @click="addBtn">点我更新</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [
        { name: "老大", id: 1 },
        { name: "老二", id: 2 },
        { name: "老三", id: 3 },
      ],
    };
  },
  methods: {
    addBtn() {
      this.arr.splice(1, 0, "新来的");
    },
  },
};
</script>

<style>
</style>